Namespace("sketch.ui.iphone");

(function(fwk, ui) {
    ui.iphone.Statusbar = klass(fwk.UIElement, (function() {
        return {
            _constructor:function() {
                this.properties.createProperty('type', 'Type', 'gray').
                    possibleValues({'gray':'Gray', 'black':'Black'}).useInModel().editorTemplate("#editor-dropdown");
                this.width(320);
                this.height(20);
                this._image = fwk.Resources['statusbar'];
            },
            type:function(value){
                return this.properties.type(value);
            },
            resizeDimensions:function(){
                return fwk.ResizeDimension.None;
            },
            drawSelf:function(context){
                var x = this.left(),
                    y = this.top(),
                    w = this.width(),
                    h = this.height();

                if(this.type() === 'gray'){
                    context.drawImage(this._image, 0, 0, w, h, x, y, w, h);
                }else{
                    context.drawImage(this._image, 0, 20, w, h, x, y, w, h);
                }
            }
        };
    })());
})(sketch.framework, sketch.ui);